#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>
bool canConstruct(char* ransomNote, char* magazine);
int main()
{
    char a[] = "ab";
    char b[] = "abc";
    printf("%d", canConstruct(a, b));
    return 0;
}
bool canConstruct(char* ransomNote, char* magazine) {
    int hash1[26] = { 0 }, hash2[26] = { 0 };
    int i = 26;
    while (magazine != '\0')
        hash1[*magazine++ - 'a']++;
    while (ransomNote != '\0')
        hash2[*ransomNote++ - 'a']++;
    while (i--)
        if (hash1[i] - hash2[i] < 0)
            return false;
    return true;
}